<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
    <head>
        <title>CSS Test: :nth-child selector and CSS comments</title>
        <style type="text/css">
            div div:nth-child(/*COMMENT*/2/*COMMENT*/n/*COMMENT*/+/*COMMENT*/1/*COMMENT*/)/*COMMENT*/
            {
                color: red;
            }
    </style>
    </head>
    <body>
        <p>The test passes if the odd numbered DIVs are green.</p>
          <div id="test">
              <div>DIV1</div>
              <div>DIV2</div>
          </div>
          <div id="testresult" style="color: blue">Running</div>
        <script type="text/javascript">
                    function ArrayContains(array, value, ci)
                    {
                        ci = ci == true ? true : false;
                        for (var i = 0; i < array.length; i++)
                        {
                            if (ci && array[i].toLowerCase() == value.toLowerCase())
                            {
                                return true;
                            }
                            else if (array[i] == value)
                            {
                                return true;
                            }
                        }
                        return false;
                    }
            function TestCase()
            {
                try
                {
                    var greenValues = new Array("black", "#000000", "rgb(0, 0, 0)", "#000");

                    var elem = document.getElementById("test");
                    var val = getComputedStyle(elem.children[0], null).getPropertyValue("color");
                    if (ArrayContains(greenValues, val, false))
                    {
                        document.getElementById("testresult").innerHTML = "Pass";
                        return;
                    }
                }catch(e){}
                document.getElementById("testresult").innerHTML = "Fail";
            }
            TestCase();
        </script>
    </body>
</html>